<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="my" tagdir="/WEB-INF/tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/resources/js/jquery-1.8.0.js"></script>
<script type="text/javascript">
	$(document).ready(function() {

		var checkBox = $('#encryptionNeeded1');
		checkBox.click(function() {
			var algInput = $('#algorithm');
			var passInput = $('#password');
			if (checkBox.is(':checked')) {
				algInput.attr('disabled', false);
				passInput.attr('disabled', false);
			} else {
				algInput.attr('disabled', true);
				passInput.attr('disabled', true);
			}
		})
	})
</script>
</head>
<body>

	<div id="content">
		<div id="main">
			<c:url var="createProject" value='create' />
			<form:form id="newProjectForm" action="${createProject}"
				method="POST" commandName="project">
				<form:label path="name">Project name: </form:label>
				<form:input path="name" />
				<br />
				<form:checkbox path="encryptionNeeded" label="Encryption needed" />
				<br />
				<form:label path="algorithm">Algorithm </form:label>
				<form:select path="algorithm" disabled="true">
					<form:options items="${algList}" />
				</form:select>
				<br />
				<form:label path="password">Password: </form:label>
				<form:password path="password" showPassword="true" disabled="true" />
				<br />
				<input id="createButton" type="submit" value="Create" />
			</form:form>
		</div>
	</div>

</body>
</html>